package cj.web.uc.dao;
/*
 *  
 *  
*/
import java.util.List;
import java.util.Map;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;

/**
 * 
 * @author 
 *
 */
@DAO
public interface WatchHistoryDAO{
	
	@SQL("SELECT a.*,b.name as memberName,c.name as videoName,c.url as videoUrl FROM WatchHistory a left join member b on a.memberId = b.id left join video c on a.videoId =c.id WHERE a.memberId = :1 ORDER BY a.createAt DESC LIMIT :2,:3")
    List<Map> query(int memberId,int start,int length);
	
	@SQL("SELECT count(1) FROM WatchHistory WHERE memberId = :1 ")
    int querySize(int memberId);
	
}